package org.javaboy.cluster_demo.consumer;

import org.javaboy.cluster_demo.config.DirectConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectConsumer {

    private static final Logger logger = LoggerFactory.getLogger(DirectConsumer.class);

    @RabbitListener(queues = DirectConfig.DIRECT_QUEUE01)
    public void receive(String message) {
        logger.info("receive 接收到消息: {}", message);
    }

    @RabbitListener(queues = DirectConfig.DIRECT_QUEUE02)
    public void receive2(String message) {
        logger.info("receive2 接收到消息: {}", message);
    }
}
